<html>
<head><meta charset="utf-8"><title>integration tests · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html">integration tests</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189116622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189116622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189116622">(Feb 26 2020 at 14:09)</a>:</h4>
<p>Anyone what the current status of rust-analyzer regarding integration tests? I seem to have complaints about code not being used and also code not being formatted when writing more than one integration test files</p>



<a name="189116635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189116635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189116635">(Feb 26 2020 at 14:09)</a>:</h4>
<p>Would love to contribute and fix this issue if I know the current state</p>



<a name="189116916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189116916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189116916">(Feb 26 2020 at 14:13)</a>:</h4>
<p>Making a small example that reproduces the issue would be a good first step. It works for me, but I had to restart RA after adding the integration test.</p>



<a name="189117005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189117005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189117005">(Feb 26 2020 at 14:14)</a>:</h4>
<p>You generally need to do this when changing <code>Cargo.toml</code>, <code>Cargo.lock</code> or when adding new build targets.</p>



<a name="189117013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189117013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189117013">(Feb 26 2020 at 14:14)</a>:</h4>
<p>Huh, I didn't try that, but I seem to have tried restarting vscode</p>



<a name="189117042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189117042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189117042">(Feb 26 2020 at 14:14)</a>:</h4>
<p>Even adding new examples, I guess?</p>



<a name="189117050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189117050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189117050">(Feb 26 2020 at 14:14)</a>:</h4>
<p>I think so. I mean you don't <strong>have</strong> to restart it, but some features might not work correctly.</p>



<a name="189117078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189117078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189117078">(Feb 26 2020 at 14:15)</a>:</h4>
<p>Thanks for the info. I will look into it a bit tonight</p>



<a name="189139154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189139154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189139154">(Feb 26 2020 at 17:55)</a>:</h4>
<p>So, I restarted it, but the issues didn't go away. Shown is the code for the integration test. <a href="/user_uploads/4715/DkZVqrA_6_8fS8pIE2P1m8Np/content_type_tide_rs__reign.png" target="_blank" title="content_type_tide_rs__reign.png">content_type_tide.rs</a>. As you can see, I am using the type <code>ContentType</code> but there's a warning. This is not happening for all the integration tests, though. <a href="/user_uploads/4715/b0YfXNyJLEep2Z2WxeFLE6JX/content_type_tide_rs__reign-2.png" target="_blank" title="content_type_tide_rs__reign-2.png">files</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/DkZVqrA_6_8fS8pIE2P1m8Np/content_type_tide_rs__reign.png" target="_blank" title="content_type_tide.rs"><img src="/user_uploads/4715/DkZVqrA_6_8fS8pIE2P1m8Np/content_type_tide_rs__reign.png"></a></div><div class="message_inline_image"><a href="/user_uploads/4715/b0YfXNyJLEep2Z2WxeFLE6JX/content_type_tide_rs__reign-2.png" target="_blank" title="files"><img src="/user_uploads/4715/b0YfXNyJLEep2Z2WxeFLE6JX/content_type_tide_rs__reign-2.png"></a></div>



<a name="189139711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189139711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189139711">(Feb 26 2020 at 18:01)</a>:</h4>
<p>If you remove the feature attribute does it work?</p>



<a name="189149971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189149971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189149971">(Feb 26 2020 at 19:31)</a>:</h4>
<p>Not sure about this, because the feature is tied into so many things. But the <code>content_type_gotham.rs</code> you see has similar stuff. Feature attribute followed by <code>tokio::test</code> followed by <code>async</code> and that file is good</p>



<a name="189172496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189172496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189172496">(Feb 26 2020 at 23:36)</a>:</h4>
<p>Also, I had all features enabled for cargo check option set to true</p>



<a name="189176489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189176489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189176489">(Feb 27 2020 at 00:36)</a>:</h4>
<p>We should verify that the features work. I tried it last week while working on <code>lsp-types</code> and could not get the "proposed" feature to work.</p>



<a name="189212466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189212466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189212466">(Feb 27 2020 at 13:16)</a>:</h4>
<p>So, you are saying that only some features might work?</p>



<a name="189433562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189433562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189433562">(Mar 01 2020 at 13:35)</a>:</h4>
<p><span class="user-mention" data-user-id="203366">@Jeremy Kolb</span> <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> So, based on the behaviour, I figured out that only default features are being used when checking integration tests. Even though I have <code>all features</code> setting enabled. Does that narrow the bug?</p>



<a name="189433719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189433719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189433719">(Mar 01 2020 at 13:41)</a>:</h4>
<p>What I meant is that if you add new dependencies or targets, some RA features might not work properly until you restart the server.</p>



<a name="189433934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189433934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189433934">(Mar 01 2020 at 13:48)</a>:</h4>
<p>There might be issues in the cargo check integration, I'm not sure how setting the features works. It doesn't match my expectations -- it looks like it should trigger extra recompiles, but I didn't notice it. Anyway, if you have a small project that reproduces your problem, you could file an issue on GitHub.</p>



<a name="189434664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189434664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189434664">(Mar 01 2020 at 14:13)</a>:</h4>
<p>Like, I wouldn't be surprised if that <code>allFeatures</code> option didn't work at all.</p>



<a name="189434772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189434772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189434772">(Mar 01 2020 at 14:16)</a>:</h4>
<p>Maybe I'm missing something, but I don't see where that setting is wired up.</p>



<a name="189434822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189434822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189434822">(Mar 01 2020 at 14:18)</a>:</h4>
<p>Ah, it's using <code>#[serde(rename_all = "camelCase")]</code></p>



<a name="189435216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435216">(Mar 01 2020 at 14:30)</a>:</h4>
<p><span class="user-mention" data-user-id="254853">@pksunkara</span> It works for me if I set:</p>
<div class="codehilite"><pre><span></span>    <span class="s2">&quot;rust-analyzer.cargo-watch.arguments&quot;</span><span class="err">:</span> <span class="p">[</span>
        <span class="s2">&quot;--features&quot;</span><span class="p">,</span>
        <span class="s2">&quot;broken&quot;</span>
    <span class="p">]</span>
</pre></div>


<p>or</p>
<div class="codehilite"><pre><span></span><span class="s2">&quot;rust-analyzer.cargo-watch.arguments&quot;</span><span class="err">:</span> <span class="p">[</span>
        <span class="s2">&quot;--all-features&quot;</span><span class="p">,</span>
    <span class="p">]</span><span class="err">,</span>
</pre></div>



<a name="189435334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435334">(Mar 01 2020 at 14:34)</a>:</h4>
<p>I filed <a href="https://github.com/rust-analyzer/rust-analyzer/issues/3386" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/3386">https://github.com/rust-analyzer/rust-analyzer/issues/3386</a>,  which is somewhat related</p>



<a name="189435346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435346">(Mar 01 2020 at 14:35)</a>:</h4>
<p><a href="/user_uploads/4715/BFShDGRCZRBgc-PmrBTn_ioI/Settings__integrationbot.png" target="_blank" title="Settings__integrationbot.png">Settings__integrationbot.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/BFShDGRCZRBgc-PmrBTn_ioI/Settings__integrationbot.png" target="_blank" title="Settings__integrationbot.png"><img src="/user_uploads/4715/BFShDGRCZRBgc-PmrBTn_ioI/Settings__integrationbot.png"></a></div>



<a name="189435351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435351">(Mar 01 2020 at 14:35)</a>:</h4>
<p>Maybe, this option is not about activating all features for cargo-watch</p>



<a name="189435564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435564">(Mar 01 2020 at 14:43)</a>:</h4>
<p>No, I think that one is used when loading the workspace. RA runs <code>cargo metadata</code> to figure out which dependencies the project has, download them, find out the project structure and so on.</p>



<a name="189435605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435605">(Mar 01 2020 at 14:44)</a>:</h4>
<p>If you want to pass <code>--all-features</code> to <code>cargo watch</code>, you should try the other preference</p>



<a name="189435608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/integration%20tests/near/189435608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/integration.20tests.html#189435608">(Mar 01 2020 at 14:44)</a>:</h4>
<p>But beware of it compiling the code twice, as I mentioned above. If you run <code>cargo run</code> from the terminal and <code>cargo check --all-features</code> from RA, <code>cargo</code> will rebuild a lot of your project.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>